package com.hxzy.shop.feign.store;

import com.github.pagehelper.PageInfo;
import com.hxzy.shop.common.dto.store.req.StoreListReq;
import com.hxzy.shop.common.dto.store.resp.SameCityDeliveryResp;
import com.hxzy.shop.common.dto.store.resp.StoreDetailResp;
import com.hxzy.shop.common.dto.store.resp.StoreListResp;
import com.hxzy.shop.common.dto.store.resp.StoreNumResp;
import com.hxzy.shop.entity.YxtCustomer;
import com.hxzy.shop.fallback.store.StoreFallback;
import com.hxzy.shop.vo.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
 * 功能描述:门店远程访问
 *
 * @author tonneyyy
 */
@FeignClient(value = "store", fallback = StoreFallback.class)
public interface StoreFeign {

    /**
     * 商户总店数量以及已开店数量
     * @return
     */
    @GetMapping(value = "/store/storeNum")
    Result<StoreNumResp> storeNum();

    /**
     * 分页查询门店列表
     * @param req
     * @return
     */
    @GetMapping(value = "/store/list")
    Result<PageInfo<StoreListResp>> storeList(@SpringQueryMap StoreListReq req);

    /**
     * 门店详情
     * @param storeId
     * @return
     */
    @GetMapping(value = "/store/storeDetail/{storeId}")
    Result<StoreDetailResp> storeDetail(@PathVariable(value = "storeId") Long storeId);

    /**
     * 判断门店是否支持门店配送
     * @param storeId
     * @return
     */
    @GetMapping(value = "/store/checkSameCityDelivery/{storeId}")
    Result<SameCityDeliveryResp> checkSameCityDelivery(@PathVariable(value = "storeId") Long storeId);

    /**
     * 获取客服地址列表
     */
    @GetMapping("/yxt/getTenantRedirectUrl")
    Result<List<YxtCustomer>> getTenantRedirectUrl();

}
